<!DOCTYPE html>
<html>
<head>
	<title>NexHome</title>
    
	<meta name="viewport" content="width=device-width, initial-scale=1.0" />
	
    <!-- bootstrap -->
    <link href="css/bootstrap/bootstrap.css" rel="stylesheet" />
    <link href="css/bootstrap/bootstrap-responsive.css" rel="stylesheet" />
    <link href="css/bootstrap/bootstrap-overrides.css" type="text/css" rel="stylesheet" />

    <!-- libraries -->
   <link href="css/lib/jquery-ui-1.10.2.custom.css" rel="stylesheet" type="text/css" />
    <link href="css/lib/font-awesome.css" type="text/css" rel="stylesheet" />

    <!-- global styles -->
    <link rel="stylesheet" type="text/css" href="css/layout.css" />
    <link rel="stylesheet" type="text/css" href="css/elements.css" />
    <link rel="stylesheet" type="text/css" href="css/icons.css" />

    <!-- this page specific styles -->
    <link rel="stylesheet" href="css/compiled/new-user.css" type="text/css" media="screen" />    

    <!-- open sans font -->
    <link href='css/OpenSans.css' rel='stylesheet' type='text/css' />

    <!-- lato font -->
    <link href='css/Lato.css' rel='stylesheet' type='text/css' />
	
    <!--[if lt IE 9]>
      <script src="js/html5.js"></script>
    <![endif]--> 
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></head>
<body>




	<!-- main container -->
    <div class="content">       
        <div class="container-fluid">
         <div id="pad-wrapper" class="new-user">

              <div class="row-fluid header">
                    <h3>创建用户</h3>
                </div>

                <div class="row-fluid form-wrapper">
                    <!-- left column -->
                    <div class="span9 with-sidebar">
                        <div class="container">
                            <form id="userAddModalform" class="new_user_form inline-input" />
                                <div class="span12 field-box">
                                    <label>用户名:</label>
                                    <input class="span9" id="account" name="account" type="text" />
                                </div>
                                
                                <div class="span12 field-box">
                                    <label>密码:</label>
                                    <input class="span9" id="password"  name="password"  type="text" />
                                </div>
                                <div class="span12 field-box">
                                    <label>工程商名称:</label>
                                    <input class="span9" id="name" name="name" type="text" />
                                </div>
                               
                                <div class="span12 field-box textarea">
                                    <label>备注:</label>
                                    <textarea class="span9" id="projectinfo"  name="projectinfo"></textarea>
                                    <span class="charactersleft">请输入少于100个字节的信息</span>
                                </div>
                                <div class="span11 field-box actions">
                                    <input type="button" class="btn-glow primary" id="userAddModal_addbtn" value="创建用户" />
                                    <span>OR</span>
                                    <input type="reset" value="取消" class="reset" />
                                </div>
                            </form>
                        </div>
                    </div>

                    <!-- side right column -->
                    <div class="span3 form-sidebar pull-right">
                        
                        <div class="alert alert-info hidden-tablet">
                            <i class="icon-lightbulb pull-left"></i>
                           此页创建工程商账号
                        </div>                        
                        <!--<h6>Add multiple users at once</h6>
                        
                        <p>Choose one of the following file types:</p>
                        <ul>
                            <li><a href="#">Upload a vCard file</a></li>
                            <li><a href="#">Import from a CSV file</a></li>
                            <li><a href="#">Import from an Excel file</a></li>
                        </ul>-->
                    </div>
                </div>
				
				
           </div>
        </div>
    </div>
	<!-- end main container -->
	<!-- scripts -->
	<script src="js/jquery-1.10.2.min.js"></script>
    <script src="js/jquery-latest.js"></script>
    <script src="js/bootstrap.min.js"></script>	 
    <script src="js/theme.js"></script>
	<script src="js/bootbox.min.js"></script>
		
    <script type="text/javascript">
 $(function () {

// toggle form between inline and normal inputs
var $buttons = $(".toggle-inputs button");
var $form = $("form.new_user_form");
$form.removeClass("inline-input");
$('#userAddModal_addbtn').click(function (e) {
			
 $.ajax({  
		   
			url: '../adminMgr/org/addOrg', 
			type: 'post',  
			dataType: 'json',  
			timeout: 10000,  
			cache: false,
			data:$("#userAddModalform").serializeArray(),               
			error : function() {
			
			 bootbox.alert("创建用户数据异常，请重新创建", function() {					
					//return;
			});	 
			},    
			success: function(uadddata){
			
				if(uadddata.resultCode != '10000'){					
					
					
					bootbox.alert(uadddata.resultMsg, function() {					
					//return;
					});							
				}
				else{
					 
					 bootbox.alert(uadddata.resultMsg, function() {					
						$('#account').val("");
						$('#password').val("");
						$('#name').val("");
						$('#projectinfo').val("");
					});	
					
				 }
			}
			   
 })  
			  
});
});
	</script>
	
</body>
</html>